<%= link_to "Home", root_path, :class => 'brand' %>
<ul class="nav">
  <li>
    <%= link_to 'Main', root_url(:host => request.domain) %>
  </li>
  <% if request.subdomain.present? && request.subdomain != "www" %>
    <% if user_signed_in? %>
      <li>
        <%= link_to 'Edit account', edit_user_registration_url %>
      </li>
      <li>
        <%= link_to 'Logout', destroy_user_session_url, :method=>'delete' %>
      </li>
    <% else %>
      <li>
        <%= link_to 'Login', new_user_session_url %>
      </li>
    <% end %>
  <% else %>
    <li>
      <%= link_to 'Sign up', new_user_registration_url(:host => request.domain) %>
    </li>
    <% if user_signed_in? %>
      <li>
        <%= link_to 'Logout', destroy_user_session_url, :method=>'delete' %>
      </li>
    <% end %>
  <% end %>
</ul>
